.class public Lcom/xingbook/park/ui/d;
.super Landroid/app/Dialog;

# interfaces
.implements Landroid/view/View$OnClickListener;


# instance fields
.field private a:Lcom/xingbook/park/ui/e;

.field private b:Lcom/xingbook/d/a;

.field private c:Lcom/xingbook/c/n;

.field private d:Lcom/xingbook/b/f;


# direct methods
.method public constructor <init>(Landroid/app/Activity;I)V
    .locals 10

    const/16 v9, 0x11

    invoke-direct {p0, p1, p2}, Landroid/app/Dialog;-><init>(Landroid/content/Context;I)V

    instance-of v0, p1, Lcom/xingbook/park/ui/e;

    if-eqz v0, :cond_0

    move-object v0, p1

    check-cast v0, Lcom/xingbook/park/ui/e;

    iput-object v0, p0, Lcom/xingbook/park/ui/d;->a:Lcom/xingbook/park/ui/e;

    :cond_0
    invoke-virtual {p1}, Landroid/app/Activity;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Lcom/xingbook/c/n;->a(Landroid/content/Context;)Lcom/xingbook/c/n;

    move-result-object v0

    iput-object v0, p0, Lcom/xingbook/park/ui/d;->c:Lcom/xingbook/c/n;

    iget-object v0, p0, Lcom/xingbook/park/ui/d;->c:Lcom/xingbook/c/n;

    invoke-virtual {v0}, Lcom/xingbook/c/n;->h()Lcom/xingbook/d/a;

    move-result-object v0

    iput-object v0, p0, Lcom/xingbook/park/ui/d;->b:Lcom/xingbook/d/a;

    iget-object v0, p0, Lcom/xingbook/park/ui/d;->b:Lcom/xingbook/d/a;

    invoke-virtual {v0}, Lcom/xingbook/d/a;->u()Lcom/xingbook/b/b;

    move-result-object v0

    check-cast v0, Lcom/xingbook/b/f;

    iput-object v0, p0, Lcom/xingbook/park/ui/d;->d:Lcom/xingbook/b/f;

    iget-object v0, p0, Lcom/xingbook/park/ui/d;->b:Lcom/xingbook/d/a;

    iget-object v1, p0, Lcom/xingbook/park/ui/d;->b:Lcom/xingbook/d/a;

    invoke-virtual {v1}, Lcom/xingbook/d/a;->q()Lcn/a/a/a;

    move-result-object v1

    iget-object v2, p0, Lcom/xingbook/park/ui/d;->d:Lcom/xingbook/b/f;

    invoke-virtual {v2}, Lcom/xingbook/b/f;->c()I

    move-result v2

    invoke-virtual {v1, v2}, Lcn/a/a/a;->a(I)Lcn/a/a/c/a;

    move-result-object v1

    invoke-virtual {v1}, Lcn/a/a/c/a;->c()I

    move-result v1

    invoke-virtual {v0, v1}, Lcom/xingbook/d/a;->e(I)Ljava/io/InputStream;

    move-result-object v1

    const/4 v0, 0x0

    sget-object v2, Lcom/xingbook/c/n;->g:Landroid/graphics/BitmapFactory$Options;

    invoke-static {v1, v0, v2}, Landroid/graphics/BitmapFactory;->decodeStream(Ljava/io/InputStream;Landroid/graphics/Rect;Landroid/graphics/BitmapFactory$Options;)Landroid/graphics/Bitmap;

    move-result-object v0

    if-eqz v1, :cond_1

    :try_start_0
    invoke-virtual {v1}, Ljava/io/InputStream;->close()V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    :cond_1
    :goto_0
    new-instance v1, Lcom/xingbook/ui/XbLayout;

    invoke-direct {v1, p1}, Lcom/xingbook/ui/XbLayout;-><init>(Landroid/content/Context;)V

    const/4 v2, -0x1

    invoke-virtual {v1, v2}, Lcom/xingbook/ui/XbLayout;->setBackgroundColor(I)V

    invoke-static {p1}, Lcom/xingbook/c/n;->b(Landroid/app/Activity;)F

    move-result v2

    const/high16 v3, 0x4120

    mul-float/2addr v3, v2

    float-to-int v3, v3

    new-instance v4, Landroid/widget/ImageView;

    invoke-direct {v4, p1}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V

    sget-object v5, Landroid/widget/ImageView$ScaleType;->FIT_XY:Landroid/widget/ImageView$ScaleType;

    invoke-virtual {v4, v5}, Landroid/widget/ImageView;->setScaleType(Landroid/widget/ImageView$ScaleType;)V

    if-nez v0, :cond_2

    invoke-virtual {p1}, Landroid/app/Activity;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    const v5, 0x7f0202f9

    invoke-static {v0, v5}, Lcom/xingbook/c/n;->a(Landroid/content/res/Resources;I)Landroid/graphics/Bitmap;

    move-result-object v0

    :cond_2
    invoke-virtual {v0}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v5

    invoke-virtual {v0}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v6

    add-int v7, v5, v3

    add-int v8, v6, v3

    invoke-virtual {v4, v3, v3, v7, v8}, Landroid/widget/ImageView;->layout(IIII)V

    invoke-virtual {v4, v0}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    invoke-virtual {v1, v4}, Lcom/xingbook/ui/XbLayout;->addView(Landroid/view/View;)V

    new-instance v0, Lcom/xingbook/ui/ad;

    invoke-direct {v0, p1}, Lcom/xingbook/ui/ad;-><init>(Landroid/content/Context;)V

    add-int v4, v5, v3

    const/high16 v7, 0x428c

    mul-float/2addr v7, v2

    float-to-int v7, v7

    add-int/2addr v7, v3

    invoke-virtual {v0, v3, v3, v4, v7}, Lcom/xingbook/ui/ad;->layout(IIII)V

    const/high16 v4, 0x4240

    mul-float/2addr v4, v2

    float-to-int v4, v4

    int-to-float v4, v4

    iput v4, v0, Lcom/xingbook/ui/ad;->c:F

    invoke-virtual {p1}, Landroid/app/Activity;->getResources()Landroid/content/res/Resources;

    move-result-object v4

    const v7, 0x7f080023

    invoke-virtual {v4, v7}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v4

    iput-object v4, v0, Lcom/xingbook/ui/ad;->a:Ljava/lang/String;

    const/16 v4, 0x13

    iput v4, v0, Lcom/xingbook/ui/ad;->d:I

    const/high16 v4, -0x6f00

    iput v4, v0, Lcom/xingbook/ui/ad;->i:I

    iput v3, v0, Lcom/xingbook/ui/ad;->l:I

    invoke-virtual {v1, v0}, Lcom/xingbook/ui/XbLayout;->addView(Landroid/view/View;)V

    new-instance v0, Lcom/xingbook/ui/ad;

    invoke-direct {v0, p1}, Lcom/xingbook/ui/ad;-><init>(Landroid/content/Context;)V

    const/high16 v4, 0x4234

    mul-float/2addr v4, v2

    float-to-int v4, v4

    int-to-float v4, v4

    iput v4, v0, Lcom/xingbook/ui/ad;->c:F

    invoke-virtual {p1}, Landroid/app/Activity;->getResources()Landroid/content/res/Resources;

    move-result-object v4

    const v7, 0x7f080024

    invoke-virtual {v4, v7}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

    move-result-object v4

    iput-object v4, v0, Lcom/xingbook/ui/ad;->a:Ljava/lang/String;

    const v4, -0x6e00cc9a

    iput v4, v0, Lcom/xingbook/ui/ad;->i:I

    iput v9, v0, Lcom/xingbook/ui/ad;->d:I

    const/4 v4, 0x1

    invoke-virtual {v0, v4}, Lcom/xingbook/ui/ad;->setId(I)V

    invoke-virtual {v0, p0}, Lcom/xingbook/ui/ad;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    invoke-virtual {v0}, Lcom/xingbook/ui/ad;->getTextWidth()F

    move-result v4

    float-to-int v4, v4

    sub-int v4, v5, v4

    sub-int/2addr v4, v3

    add-int v7, v3, v6

    int-to-float v7, v7

    const/high16 v8, 0x4270

    mul-float/2addr v2, v8

    sub-float v2, v7, v2

    float-to-int v2, v2

    add-int v7, v3, v5

    add-int v8, v3, v6

    invoke-virtual {v0, v4, v2, v7, v8}, Lcom/xingbook/ui/ad;->layout(IIII)V

    invoke-virtual {v1, v0}, Lcom/xingbook/ui/XbLayout;->addView(Landroid/view/View;)V

    invoke-virtual {p0, v1}, Lcom/xingbook/park/ui/d;->setContentView(Landroid/view/View;)V

    invoke-virtual {p0}, Lcom/xingbook/park/ui/d;->getWindow()Landroid/view/Window;

    move-result-object v0

    invoke-virtual {v0}, Landroid/view/Window;->getAttributes()Landroid/view/WindowManager$LayoutParams;

    move-result-object v1

    invoke-virtual {v0, v9}, Landroid/view/Window;->setGravity(I)V

    mul-int/lit8 v2, v3, 0x2

    add-int/2addr v2, v5

    iput v2, v1, Landroid/view/WindowManager$LayoutParams;->width:I

    mul-int/lit8 v2, v3, 0x2

    add-int/2addr v2, v6

    iput v2, v1, Landroid/view/WindowManager$LayoutParams;->height:I

    invoke-virtual {v0, v1}, Landroid/view/Window;->setAttributes(Landroid/view/WindowManager$LayoutParams;)V

    return-void

    :catch_0
    move-exception v1

    invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V

    goto/16 :goto_0
.end method


# virtual methods
.method public cancel()V
    .locals 1

    iget-object v0, p0, Lcom/xingbook/park/ui/d;->d:Lcom/xingbook/b/f;

    invoke-virtual {v0}, Lcom/xingbook/b/f;->b()V

    invoke-super {p0}, Landroid/app/Dialog;->cancel()V

    return-void
.end method

.method public onClick(Landroid/view/View;)V
    .locals 2

    invoke-static {}, Lcom/xingbook/c/a;->a()Lcom/xingbook/c/a;

    move-result-object v0

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lcom/xingbook/c/a;->a(I)V

    invoke-virtual {p1}, Landroid/view/View;->getId()I

    move-result v0

    packed-switch v0, :pswitch_data_0

    :cond_0
    :goto_0
    return-void

    :pswitch_0
    invoke-virtual {p0}, Lcom/xingbook/park/ui/d;->dismiss()V

    iget-object v0, p0, Lcom/xingbook/park/ui/d;->a:Lcom/xingbook/park/ui/e;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/park/ui/d;->a:Lcom/xingbook/park/ui/e;

    iget-object v1, p0, Lcom/xingbook/park/ui/d;->d:Lcom/xingbook/b/f;

    invoke-virtual {v1}, Lcom/xingbook/b/f;->c()I

    move-result v1

    invoke-interface {v0, v1}, Lcom/xingbook/park/ui/e;->a(I)V

    goto :goto_0

    nop

    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
    .end packed-switch
.end method
